<!DOCTYPE html>
<html>
<head >

<style type="text/css">
h2 {color: #0080FF;}
#Origin {color:red;font-size:14px;}
#Version {color:red;font-size:14px;}
#Desktop {color:red;font-size:14px;}
</style>

<script language="javascript">

function ReadOS() {

var select = document.getElementById("Listbox");
selectedItem = select.options[select.selectedIndex].text;

    var rawFile = new XMLHttpRequest();
    rawFile.open("GET", selectedItem + "/OS.cfg", false);
    rawFile.onreadystatechange = function ()
    {
        if(rawFile.readyState === 4)
        {
            if(rawFile.status === 200 || rawFile.status == 0)
            {
			var splitfile = rawFile.responseText.split("\n")
			
				//About
				document.getElementById("Textarea_About").value = splitfile[0].replace('About:','');
				
				//Origin
				document.getElementById("Origin").innerHTML = splitfile[1].replace('Origin:','');
				
				//Version
				document.getElementById("Version").innerHTML = splitfile[2].replace('Version:','');
				
				//Desktop
				document.getElementById("Desktop").innerHTML = splitfile[3].replace('Desktop:','');
				
				//Website
				document.getElementById("Button_Website").action = splitfile[4].replace('Website:','');
				
				//Download_32
				var Download32bit = splitfile[5].replace('Download_32:','');
				document.getElementById("Form_Button_Download_32").action = Download32bit;

				
				if (Download32bit.length > 1) {
				document.getElementById("Button_Download_32").disabled = false;
				} else {
				document.getElementById("Button_Download_32").disabled = true;
				}
				
				
				
				//FileSize_32
				var FileSize32 = splitfile[6].replace('FileSize_32:','');
				document.getElementById("Button_Download_32").value = FileSize32 + " Download x32" ;
				
				//Download_64
				var Download64bit = splitfile[7].replace('Download_64:','');
				document.getElementById("Form_Button_Download_64").action = Download64bit;
				
				if (Download64bit.length > 1) {
				document.getElementById("Button_Download_64").disabled = false;
				} else {
				document.getElementById("Button_Download_64").disabled = true;
				}
				
				
				//FileSize_64
				var FileSize64 = splitfile[8].replace('FileSize_64:','');
				document.getElementById("Button_Download_64").value = FileSize64 + " Download x64";
            }
        }
    }
    rawFile.send(null);
}

function ReadOSL() {
    var rawFile = new XMLHttpRequest();
    rawFile.open("GET", "OSl.cfg", false);
    rawFile.onreadystatechange = function ()
	{
		if(rawFile.readyState === 4)
        {
			if(rawFile.status === 200 || rawFile.status == 0)
            {
			var splitfile = rawFile.responseText.split("\n")
			
	var select = document.getElementById("Listbox");
	for(index in splitfile) {
	if (splitfile[index]!==""){select.options[select.options.length] = new Option(splitfile[index], index);}
	}
        }
            }
				}
    rawFile.send(null);
}

function Get_OS() {
ReadOS();
var select = document.getElementById("Listbox");
selectedItem = select.options[select.selectedIndex].text;
document.getElementById("Picturebox_OSImage").src = "https://get-linux.googlecode.com/svn/trunk/Data/Operating Systems/" + selectedItem + "/Image.jpg";
}

//function test() {
//if (document.getElementById("Radio_32Bit").checked == true) {
//alert(document.getElementById("Radio_32Bit").value);
//document.getElementById("Button_Download").action = document.getElementById("Radio_32Bit").value;
//} else {
//alert(document.getElementById("Radio_64Bit").value);
//document.getElementById("Button_Download").action = document.getElementById("Radio_64Bit").value;
//}

//}
</script>
</head>

<body onload="ReadOSL()">

<form name="Listboxform" style="float:left;" >
<select size="15" name="Listbox" id="Listbox" onchange="Get_OS()" style="color:blakc;background-color:white;border:1px solid #0080FF;width:300px;height:400px;">
</select>
</form>

<img src="" id="Picturebox_OSImage" onclick="" style="width:328px;height:224px;float:left;">

<h2>Origin: <span id="Origin"></span></h2>

<h2>Version: <span id="Version"></span></h2>

<h2>Desktop: <span id="Desktop"></span></h2>

<br>

<!--
<form action="" onchange="test()">
<input type="radio" id="Radio_32Bit" name="Bits" value="">32Bit
<input type="radio" id="Radio_64Bit" name="Bits" value="">64Bit
</form>
-->
<br><br><br>

<textarea rows="4" cols="50" id="Textarea_About" readonly></textarea> 

<br><br>

<form action="" id="Button_Website" style="display:inline-block;" target="_blank">
<input type="submit" value="Website">
</form>

<form action="" id="Form_Button_Download_32" method="get" style="display:inline-block;">
<input type="submit" id="Button_Download_32" value="Download x32" disabled>
</form>

<form action="" id="Form_Button_Download_64" method="get" style="display:inline-block;">
<input type="submit" id="Button_Download_64" value="Download x64" disabled>
</form>


</body>

</html>